package com.ea.eadp.nexus.proxy.tests.common;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: hanli
 * Date: 7/31/14
 * Time: 12:43 PM
 * To change this template use File | Settings | File Templates.
 */
public enum NexusConnectApiEnum {

    connect_get("GET","/connect/auth");

    private String method;
    private String url;
    private String format = "json";

    private NexusConnectApiEnum(String method, String url){
        this.method = method;
        this.url = url;
    }

    private NexusConnectApiEnum(String method, String url, String format){
        this.method = method;
        this.url = url;
        this.format = format;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public static List<NexusConnectApiEnum> getApisByMethod(String method) {
        List<NexusConnectApiEnum> apis = new ArrayList<NexusConnectApiEnum>();
        for (NexusConnectApiEnum a : NexusConnectApiEnum.values()) {
            if (a.getMethod() == method) {
                apis.add(a);
            }
        }
        return apis;
    }
}
